<div class="rounded table" style="width: 98%;">
    <table width="100%" cellpadding="0" cellspacing="0" border="0" class="box_top">
        <thead class="thead">
            <tr class="space">
                <th colspan="10">会员列表</th>
            </tr>
        </thead>
    </table>
    <div class="contentbox" data-uri='{:U("Admin/Member/doEditStatus")}'>
        <table width="100%" class="list td_align">
            <thead>
                <tr class="thead">
                    <th class="align-center"><input name="id" type="checkbox" class="checkAll" id="checkboxall"  data-checklist="checkSon_x" data-direction="x"/></th>
                    <th class="align-center">编号</th>
                    <th class="align-center">头像</th>
                    <th class="align-center">用户名</th>
                    <th class="align-center">会员等级</th>
                    <th class="align-center">昵称</th>
                    <th class="align-center">邮箱</th>
                    <th class="align-center">账户余额</th>
                    <th class="align-center">性别</th>
                    <th class="align-center">状态</th>
                    <th class="align-center">管理操作</th>
                </tr>
            </thead>
            <tbody>
            <volist name="data" id="list">
                <tr>
                    <td class="align-center">
                        <input type="checkbox" value="{$list.id}" name="checkall" class="checkSon" data-xid="checkSon_x"/>
                    </td>
                    <td class="align-center">{$list.m_id}</td>
                    <td class="align-center"><img src="__PUBLIC__/{$list.m_pic|default='Admin/images/default_avatar.jpg'}" title="{$list.m_name}" width="48px" height="48px"/></td>
                    <td class="align-center">{$list.m_name}</td>
                    <td class="align-center">
                        {$list.ml_name}
                        <if condition='$list.m_enteruser eq "1"'><br /><font color='red'>认证用户</font></if>
                    </td>
                    <td class="align-center">{$list.m_nickname}</td>
                    <td class="align-center">{$list.m_email}</td>
                    
                    <td class="align-center">{$list.m_balance|sprintf='%.2f',###}</td>
                    <td class="align-center">
                        <if condition="$list.m_sex eq '1'">
                            男
                            <elseif condition="$list.m_sex eq '2'"/>
                            女
                            <else />
                            保密
                        </if>
                    </td>
                    <td class="align-center"><a href="javascript:void(0);" id="list_{$list.m_id}" class="m_status" m_status="{$list.m_status}" m_id="{$list.m_id}"><if condition="$list.m_status eq '1'">已审核<else />未审核</if></a></td>
                    <td class="align-center">
                        <div class="button-group">
                            <a href='{:U("Admin/Member/editMember","mid=$list[m_id]")}'  class="button danger icon pill edit" alt="编辑" title="编辑"></a>
                            <a href="javascript:void(0);"  data-uri='{:U("Admin/Member/doDelete","m_id=$list[m_id]")}' val="{$list[m_id]}" data-msg="确定要删除 <font color='red'>{$list.m_name}</font> 吗？" data-acttype="ajax" class="button danger icon pill remove dodel" title="删除"></a>

                        </div>
                    </td>
                </tr>
            </volist>
            <empty name="data">
                <tr><td colspan="99">暂时没有数据!</td></tr>
            </empty>
            </tbody>
        </table>
        <include file="Common:incPage" />
        <div style="clear: both;"></div>
    </div>

</div>
<script>
    $(document).ready(function(){
        //审核会员
        $(".m_status").click(function(){
            var m_status = $(this).attr("m_status");
            var m_id = $(this).attr("m_id");
            var uri = $(".contentbox").attr("data-uri");
            $.ajax({
                url:uri,
                cache:false,
                dataType:'json',
                type:'POST',
                data:{m_id:m_id,m_status:m_status},
                success:function(msgObj){
                    if(msgObj.success == '1'){
                        $("#list_"+m_id).html(msgObj.data.statusMsg);
                        $("#list_"+m_id).attr("m_status",msgObj.data.status);
                    }else{
                        showMessage(msgObj.success,msgObj.msg,'',2);
                    }
                }
            });
        });
        
        //删除会员
        $(".dodel").click(function(){
            var title = $(this).attr("data-msg");
            var uri = $(this).attr("data-uri");
            $.dialog.confirm(title, function () {
                $.ajax({
                    url:uri,
                    cache:false,
                    dataType:'json',
                    type:'GET',
                    data:{},
                    success:function(msgObj){
                        showMessage(msgObj.status,msgObj.info,"{:U('Admin/Member/index')}");
                        return false;
                    }
                });
            }, function () {
            });
        });
    });
</script>